package FactorMethod.idcard;
import FactorMethod.framework.*;
import java.util.*;
public class IDCardFactory extends Factory{
    private List owners=new ArrayList();
    private static int cardid=1;//新增静态变量用于生成编号
    //实现createProduct和registerProduct
    protected Product createProduct(String owner){
        return new IDCard(owner,cardid++);
    }
    protected void registerProduct(Product product){
        owners.add(((IDCard)product).getOwner());
    }
    public List getOwners(){
     return owners;
    }
}
